<template>
  <div
    class="mybutton"
    :class="{ login: type === 'success', regist: type === 'danger' }"
    @click="clickbtn"
  >
    <slot></slot>
  </div>
</template>

<script>
export default {
  props: {
    type: {
      type: String,
    },
  },
  methods: {
    clickbtn(e) {
      this.$emit("click", e);
    },
  },
};
</script>

<style lang="less" scoped>
.mybutton {
  width: 318/380 * 100vw;
  height: 50px;
  background-color: #ccc;
  color: #fff;
  border-radius: 25px;
  text-align: center;
  line-height: 48px;
}
.login {
  background-color: rgb(86, 214, 96);
}
.regist {
  background-color: rgb(216, 141, 111);
}
</style>
